<%@ page import="com.ama.utils.SpringUtils" %>
<%@ page import="com.ama.service.impl.RoomServiceImpl" %>
<%@ page import="com.ama.pojo.Room" %>
<%@ page import="java.util.List" %>
<%@ page import="com.ama.service.RoomService" %>
<%@ page import="com.ama.dao.RoomDao" %>
<%@ page import="com.baomidou.mybatisplus.core.conditions.query.QueryWrapper" %><%--
  Created by IntelliJ IDEA.
  User: AMAZZED
  Date: 2020/12/19
  Time: 14:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>房间</title>
    <link rel="icon" href="favicon.ico" type="image/ico">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="author" content="">
    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <link href="../css/materialdesignicons.min.css" rel="stylesheet">
    <link href="../css/style.min.css" rel="stylesheet">
</head>

<%
    Long buildId = Long.valueOf(request.getParameter("build"));
    RoomServiceImpl roomService = SpringUtils.getBean(RoomServiceImpl.class);
    RoomDao roomDao = SpringUtils.getBean(RoomDao.class);
    QueryWrapper wrapper = new QueryWrapper();
    wrapper.eq("room_open",1);
    wrapper.eq("build_id",buildId);
    List<Room> rooms = roomDao.selectList(wrapper);

%>
<body>
<div class="container-fluid p-t-15">

    <div class="row">
        <div class="col-lg-12">
            <div class="card">
                <div class="card-header"><h4>表单向导</h4></div>
                <div class="card-body">

                    <form action="/genderJudgment" method="post" class="guide-box" data-navigateable="true">
                        <ul class="nav-step step-dots">
                            <li class="nav-step-item active">
                                <span>小区</span>
                                <a class="active" data-toggle="tab" href="#step-1"></a>
                            </li>

                            <li class="nav-step-item active">
                                <span>楼栋</span>
                                <a data-toggle="tab" href="#step-2"></a>
                            </li>

                            <li class="nav-step-item active">
                                <span>房屋</span>
                                <a data-toggle="tab" href="#step-3"></a>
                            </li>

                            <li class="nav-step-item">
                                <span>床铺</span>
                                <a data-toggle="tab" href="#step-4"></a>
                            </li>
                            <li class="nav-step-item">
                                <span>申请单</span>
                                <a data-toggle="tab" href="#step-4"></a>
                            </li>
                        </ul>
                        <!--对应内容-->
                        <div class="nav-step-content">
                            <div class="fixed-table-container" style="padding-bottom: 0px;">
                                <div class="fixed-table-header" style="display: none;">
                                    <table></table>
                                </div>
                                <div class="fixed-table-body">
                                    <div class="fixed-table-loading table table-bordered table-hover table-striped"
                                         style="top: 44px; display: none;">
        <span class="loading-wrap">
        <span class="loading-text">正在努力地加载数据中，请稍候</span>
        <span class="animation-wrap"><span class="animation-dot"></span></span>
        </span>
                                    </div>
                                    <table id="tb_departments" class="table table-bordered table-hover table-striped">
                                        <thead class="">
                                        <tr>
                                            <th class="bs-checkbox " style="width: 36px; " data-field="0">
                                                <div class="th-inner "><label class="lyear-radio radio-primary"></label></div>
                                            </th>
                                            <th style="" data-field="id">
                                                <div class="th-inner sortable both">ID</div>
                                                <div class="fht-cell"></div>
                                            </th>
                                            <th style="" data-field="author">
                                                <div class="th-inner ">房间楼层</div>
                                                <div class="fht-cell"></div>
                                            </th>
                                            <th style="" data-field="dynasty">
                                                <div class="th-inner ">房间号</div>
                                                <div class="fht-cell"></div>
                                            </th>
                                            <th style="" data-field="nationality">
                                                <div class="th-inner ">可用面积</div>
                                                <div class="fht-cell"></div>
                                            </th>
                                            <th style="" data-field="opus">
                                                <div class="th-inner ">租用面积</div>
                                                <div class="fht-cell"></div>
                                            </th>
                                            <th style="" data-field="opus">
                                                <div class="th-inner ">公摊面积</div>
                                                <div class="fht-cell"></div>
                                            </th>
                                            <th style="" data-field="opus">
                                                <div class="th-inner ">租用单价</div>
                                                <div class="fht-cell"></div>
                                            </th>
                                            <th style="" data-field="category">
                                                <div class="th-inner ">铺位数</div>
                                                <div class="fht-cell"></div>
                                            </th>
                                            <th style="" data-field="status">
                                                <div class="th-inner ">状态</div>
                                                <div class="fht-cell"></div>
                                            </th>
                                            <th style="" data-field="operate">
                                                <div class="th-inner ">操作</div>
                                                <div class="fht-cell"></div>
                                            </th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <%
                                            int status = 1;
                                            for (Room room : rooms){
                                        %>
                                        <tr class="">
                                            <td class="bs-checkbox ">
                                                <label class=" lyear-radio radio-primary ">
                                                    <input data-index="0" name="room" type="radio" <% if(status==1){%>checked<%}%> <% if(room.getRoomState()==-1){%> disabled<%}%>  value="<%=room.getRoomId()%>">
                                                    <span></span>
                                                </label></td>
                                            <td style=""><%=status%></td>
                                            <td style=""><%=room.getRoomFloor()%></td>
                                            <td style=""><%=room.getRoomName()%></td>
                                            <td style=""><%=room.getRoomEffectarea()%>㎡</td>
                                            <td style=""><%=room.getRoomRentarea()%>㎡</td>
                                            <td style=""><%=room.getRoomPublicarea()%>㎡</td>
                                            <td style=""><%=room.getRoomPrice()%>㎡</td>
                                            <td style=""><%=room.getBednum()%></td>

                                            <%
                                            if(room.getRoomState()==1){
                                            %>
                                            <td style="">
                                                <a href="javascript:void(0)" data-name="status" data-pk="1"
                                                   class="label label-success editable editable-click"
                                                   data-value="1">正常
                                                </a>
                                            </td>
                                            <%
                                            }else if(room.getRoomState()==-1){
                                            %>
                                            <td style="">
                                                <a href="javascript:void(0)" data-name="status" data-pk="1"
                                                   class="label label-danger editable editable-click"
                                                   data-value="1">无空位
                                                </a>
                                            </td>
                                            <%
                                                }
                                            %>

                                            <td style="">
                                                <button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="bottom"
                                                        data-content="<%=room.getRoomInfo()%>">
                                                    简述
                                                </button>

                                            </td>
                                        </tr>

                                       <%
                                           status++;}
                                       %>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="fixed-table-footer" style="display: none;">
                                    <table>
                                        <thead>
                                        <tr></tr>
                                        </thead>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!--End 对应内容-->
                        <hr>
                        <div class="nav-step-button">
                            <a class="btn btn-secondary " data-wizard="prev" type="button" href="s_build.jsp?estate=<%=rooms.get(0).getEstateId()%>">上一步</a>
                            <button class="btn btn-secondary" data-wizard="next" type="submit">下一步</button>
                        </div>
                    </form>

                </div>
            </div>
        </div>

    </div>

</div>

<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/main.min.js"></script>
<!--向导插件-->
<script type="text/javascript" src="../js/jquery.bootstrap.wizard.min.js"></script>

</body>
</html>
